Azure Web PubSub Service REST API (stable:2024-12-01)

2025/02/26 • 25 new methods

HealthApi_GetServiceStatus (new)
Description Get service health status.
Reference Link ¶

⚼ Request

HEAD:  /api/health
{
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{}
WebPubSub_AddConnectionsToGroups (new)
Description Add filtered connections to multiple groups.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:addToGroups
{
hub: string ,
api-version: string ,
groupsToAdd:
{
groups:
[
string ,
]
,
filter: string ,
}
,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_CloseAllConnections (new)
Description Close the connections in the hub.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:closeConnections
{
hub: string ,
excluded: array ,
reason: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_GenerateClientToken (new)
Description Generate token for the client to connect Azure Web PubSub service.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:generateToken
{
hub: string ,
userId: string ,
role: array ,
minutesToExpire: integer ,
api-version: string ,
group: array ,
clientType: string ,
}

⚐ Response (200)

{
token: string ,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RemoveConnectionsFromGroups (new)
Description Remove filtered connections from multiple groups.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:removeFromGroups
{
hub: string ,
api-version: string ,
groupsToRemove:
{
groups:
[
string ,
]
,
filter: string ,
}
,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_SendToAll (new)
Description Broadcast content inside request body to all the connected client connections.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:send
{
hub: string ,
excluded: array ,
api-version: string ,
message: string ,
filter: string ,
messageTtlSeconds: integer ,
}

⚐ Response (202)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_CloseConnection (new)
Description Close the client connection.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/connections/{connectionId}
{
hub: string ,
connectionId: string ,
reason: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_ConnectionExists (new)
Description Check if the connection with the given connectionId exists.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/connections/{connectionId}
{
hub: string ,
connectionId: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
x-ms-error-code: string ,
}
WebPubSub_SendToConnection (new)
Description Send content inside request body to the specific connection.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/connections/{connectionId}/:send
{
hub: string ,
connectionId: string ,
api-version: string ,
message: string ,
messageTtlSeconds: integer ,
}

⚐ Response (202)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RemoveConnectionFromAllGroups (new)
Description Remove a connection from all groups.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/connections/{connectionId}/groups
{
hub: string ,
connectionId: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_GroupExists (new)
Description Check if there are any client connections inside the given group
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/groups/{group}
{
hub: string ,
group: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
x-ms-error-code: string ,
}
WebPubSub_CloseGroupConnections (new)
Description Close connections in the specific group.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/groups/{group}/:closeConnections
{
hub: string ,
group: string ,
excluded: array ,
reason: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_SendToGroup (new)
Description Send content inside request body to a group of connections.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/groups/{group}/:send
{
hub: string ,
group: string ,
excluded: array ,
api-version: string ,
message: string ,
filter: string ,
messageTtlSeconds: integer ,
}

⚐ Response (202)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_ListConnectionsInGroup (new)
Description List connections in a group.
Reference Link ¶

⚼ Request

GET:  /api/hubs/{hub}/groups/{group}/connections
{
hub: string ,
group: string ,
maxpagesize: integer ,
top: integer ,
continuationToken: string ,
api-version: string ,
}

⚐ Response (200)

{
value:
[
{
connectionId: string ,
userId: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RemoveConnectionFromGroup (new)
Description Remove a connection from the target group.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/groups/{group}/connections/{connectionId}
{
hub: string ,
group: string ,
connectionId: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_AddConnectionToGroup (new)
Description Add a connection to the target group.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/groups/{group}/connections/{connectionId}
{
hub: string ,
group: string ,
connectionId: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RevokePermission (new)
Description Revoke permission for the connection.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_CheckPermission (new)
Description Check if a connection has permission to the specified action.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
x-ms-error-code: string ,
}
WebPubSub_GrantPermission (new)
Description Grant permission to the connection.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_UserExists (new)
Description Check if there are any client connections connected for the given user.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/users/{userId}
{
hub: string ,
userId: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
x-ms-error-code: string ,
}
WebPubSub_CloseUserConnections (new)
Description Close connections for the specific user.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/users/{userId}/:closeConnections
{
hub: string ,
userId: string ,
excluded: array ,
reason: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_SendToUser (new)
Description Send content inside request body to the specific user.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/users/{userId}/:send
{
hub: string ,
userId: string ,
api-version: string ,
message: string ,
filter: string ,
messageTtlSeconds: integer ,
}

⚐ Response (202)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RemoveUserFromAllGroups (new)
Description Remove a user from all groups.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/users/{userId}/groups
{
hub: string ,
userId: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_RemoveUserFromGroup (new)
Description Remove a user from the target group.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/users/{userId}/groups/{group}
{
hub: string ,
group: string ,
userId: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}
WebPubSub_AddUserToGroup (new)
Description Add a user to the target group.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/users/{userId}/groups/{group}
{
hub: string ,
group: string ,
userId: string ,
api-version: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
inner:
{
code: string ,
inner: string ,
}
,
}
,
}